package com.ziyia.a14;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import java.io.Serializable;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
    }

    public void getSerializableData(View view) {
        Person person = (Person) getIntent().getSerializableExtra("person_data");
        Toast.makeText(MyApplication.conText, person.toString(), Toast.LENGTH_SHORT).show();
    }

    public void getParcelableData(View view) {
        Person2 person2 = getIntent().getParcelableExtra("person2_data");
        Toast.makeText(MyApplication.conText, person2.toString(), Toast.LENGTH_SHORT).show();
    }
}